<div id="alternatives-grid">
	<span class="page-heading">Alternatives</span>
	<div id="sort-input">
		<?php
			echo "<form class='normal-text'>";
			// select category
			echo '<span id="category_box"> Category: ';
			echo '<select name="choose_category" id="choose_category" onchange="search()" />';
			echo "<option value='0'> All </option>";
			foreach ($category as $cat) {
				if ($selectedcategory && $selectedcategory == $cat['category_id'])
					echo "<option value ='" . $cat['category_id'] . "' selected='selected'>". $cat['category_name'] . "</option>";
				else
					echo "<option value ='" . $cat['category_id'] . "'>". $cat['category_name'] . "</option>";
			}
			echo '</select>';
			echo '</span>';
			echo '&nbsp&nbsp&nbsp&nbsp';
			// select location
			echo '<span id="location_box"> Location: ';
			echo '<select name="choose_location" id="choose_location" onchange="search()" />';
			echo "<option value='0'> All </option>";
			foreach ($location as $loc) {
				echo "<option value ='" . $loc['alternative_location_id'] . "'>". $loc['alternative_location_name'] . "</option>";
			}
			echo '</select>';
			echo '</span>';
			echo "</form>";
		?>
	</div>
	<div class="horizontal-bar"></div>
	<div id="alternatives-container"></div>
	<div id="paginator"></div>
	<div style="height: 30px"></div>
</div>

<?php
	$json = json_encode($alternative);
	echo '<script type="text/javascript">var base_url = "' . base_url() . '";</script>';
	echo '<script type="text/javascript">var alternatives = ' . $json . ';</script>';
?>